﻿using Collection.Entities;
using Super.Collection.Interfaces;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Itfort;
namespace Super.Collection.Services
{
    public class LotteryBriefingService : ServiceBase, ILotteryBriefingService
    {
        /// <summary>
        /// 插入一条中奖公告
        /// </summary>
        /// <param name="lotteryBriefing">中奖公告</param>
        public void Insert(LotteryBriefing lotteryBriefing)
        {
            this.DbSession.Save<_LotteryBriefing>(lotteryBriefing.Convert2<_LotteryBriefing>());
        }

        /// <summary>
        /// 根据期号，彩种，数据提供商获取公告信息
        /// </summary>
        /// <param name="serialNumber"></param>
        /// <param name="ticketId"></param>
        /// <param name="provider"></param>
        /// <returns></returns>
        public LotteryBriefing Get(string serialNumber, int ticketId, int provider)
        {
            return this.DbSession.Single<_LotteryBriefing>(_LotteryBriefing._.SerialNumber == serialNumber
                && _LotteryBriefing._.LotteryTicketId == ticketId && _LotteryBriefing._.Provider == provider)
        .Convert2<LotteryBriefing>();
        }
    }
}
